import u from "../utils";
import {DATA} from "../constants";
import fetch from "../utils/fetch";

const _api = u.api(DATA);
const _fetch = fetch(DATA);

export default {
    taskList: appid => _api('getTaskList', { data: { appid } }),
    data: params => _api('getAppData', { data: params }),
    path: taskid => _api('getDataPathNode', { data: { taskid } }),
    analysis: appid => _api('getAnalysis', { data: { appid } }),
    delete: params => _api('deleteAppData',{ data: params }),
    filterDatas: params => _api('getAppFilterData',{ data: params }),
    saveExcelStyle: params => _api('saveExcelStyle',{ data:params, type: 'post'}),
    getExcelStyle: params => _api('getExcelStyle',{ data:params}),
    detailData: (dataid, formid) => _api('getAppDataDetail', { data: {dataid, formid} }),
    update: data => {
        return _fetch('updateData', {
            method: 'post',
            body: data
        });
    },
}